package com.jc.vm;

public class StackOutOfMemoryDemo {
	
	
	private void dontStop(){
		while(true){
			
		}
	}
	public void stackLeakByThread(){
		while(true){
			Thread t = new Thread(new Runnable() {
				
				@Override
				public void run() {
					dontStop();
				}
			});
			t.start();
		}
	}
	
	public static void main(String[] args) throws InterruptedException {
		Thread.sleep(10000);
		StackOutOfMemoryDemo demo = new StackOutOfMemoryDemo();
		demo.stackLeakByThread();
	}
}
